class timber.ui.control.SliderHandle extends MovieClip
{
	
	// sets the position of the handle
	public function setPosition(val) {
		this._y = val;
		
	}

	public function onPress() {
		this._parent.dragging = true;
		this.startDrag(false, this._x, this._parent.handlemin, this._x, this._parent.handlemax);
		this.onEnterFrame = function() {
			this._parent.setValue(Math.ceil((this._y-this._parent.handlemin) * (this._parent.range)/this._parent.channelheight + this._parent.minval));
		}
	}

	
	public function onRelease() {
		this._parent.dragging = false;
		this.stopDrag();
		delete (this.onEnterFrame);
	}

	public function onReleaseOutside() {
		onRelease();
	}
	
}
